package com.gxc.authcore.system.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;

@Controller("common/infoController")
public class InfoController {

	/**
	 * 出错页面
	 * 
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public ModelAndView error(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		Map model = new HashMap();
		String error_info = request.getParameter("error_info");
		model.put("error_info", error_info);
		return new ModelAndView("default/error.vm", model);
	}

	/**
	 * 无权访问页面
	 * 
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public ModelAndView noAccess(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		Map model = new HashMap();
		String no_access_info = request.getParameter("no_access_info");
		model.put("no_access_info", no_access_info);
		return new ModelAndView("default/access.vm", model);
	}

}
